<template>
    <div class="navbar">
        <van-nav-bar
        :right-text="`${isShow ? '' : (isEdit ? '完成' : '编辑')}`"
        left-arrow
        @click-right="Edit"
        id="nav"
        />
    </div>
</template>

<script>
export default {
    name:'navbar',
    props:{
        isShow:{
            type:Boolean
        }
    },
    data(){
        return{
            isEdit:false
        }
    },
    methods:{
        Edit(){
            this.isEdit = !this.isEdit
            this.$emit('state',this.isEdit)
        }
    }
}
</script>

<style scoped>
.navbar{
    position:fixed;
    top:0;
    left:0;
    right:0;
    z-index:999;
}
#nav /deep/ .van-icon{
    color:#999;
}
#nav /deep/ .van-nav-bar__text{
    color:#F8531B;
}
</style>